package alexandria.dashboard.connector

/**
 * Creation Service Connectors
 * 
 * @version 0.3
 * @author  Samuel Rodrigues
 * @author  Vinícius Rodrigues
 */
class ConnectorFactoryService {
    
    def agileZenConnectorService

    static transactional = true

    /**
     * Factory Method of Connectors
     * 
     * @param   Receives a Map config, containing the name of the connector to be used and identified by the name key, and additional settings required for each strategy connection specific
     * @return  Returns the connection required in accordance with the strategy used in the connector configuration
     * @author  Samuel Rodrigues
     * @author  Vinícius Rodrigues
     */
    def getConnector(Map config) {
        if (config) {
            switch (config.name) {
                case 'agilezen':
                    agileZenConnectorService.setConfig(config)
                    return agileZenConnectorService
            }
        }
    }
}
